package com.hut.oa.model.dao.address;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.hut.oa.model.bean.AddressBook;
import com.hut.oa.model.bean.AddressDir;
import com.hut.oa.model.bean.Apply;
import com.hut.oa.model.bean.DeptOffice;
import com.hut.oa.model.bean.User;

public interface AddressDirDao extends PagingAndSortingRepository<AddressDir, Long>{
	
	//通过user寻找你的分类
	List<AddressDir> findByUser(User user);
	
	@Query("update AddressDir  set name=:name where id=:id And user=:u")
	@Modifying
	int updatebyid(@Param("name")String value,@Param("id")Long id,@Param("u")User u);
}
